LINUX: PVonHVM: Fixes to build with kernels back to 2.6.5.
authorIan Campbell <ian.campbell@xensource.com>
Thu, 5 Apr 2007 14:38:09 +0000 (15:38 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Thu, 5 Apr 2007 14:38:09 +0000 (15:38 +0100)
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c
linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h

index 158c3b10cd69dd806c58c9bcb98e21eb90300c7e..932e2079d722ce32a41335b349ef7d48e41eaa34 100644 (file)
 #include <xen/xenbus.h>
 #include "common.h"
 
+#ifdef HAVE_XEN_PLATFORM_COMPAT_H
+#include <xen/platform-compat.h>
+#endif
+
 #ifdef CONFIG_PROC_FS
 static struct proc_dir_entry *balloon_pde;
 #endif
index 463a9f7e3b78dfc8bcd1138dd2bd9a4af9e5b505..607923236486d0906755fc2cddf6b8b08de77eb1 100644 (file)
 #include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
+#include <linux/string.h>
 #include <linux/sysdev.h>
 #include "common.h"
 
+#ifdef HAVE_XEN_PLATFORM_COMPAT_H
+#include <xen/platform-compat.h>
+#endif
+
 #define BALLOON_CLASS_NAME "memory"
 
 #define BALLOON_SHOW(name, format, args...)                    \
index 0d7d4ca700e14cf3de70bac0d3336eeec3af08e7..712c928912c9379c17b1f0ab4b972c1a68bab302 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
+#include <linux/mutex.h>
 #include <asm/hypervisor.h>
 #include <xen/evtchn.h>
 #include <xen/interface/io/fbif.h>
index d327d703ead41951eba751c35ca451f4bd0f38c0..f6a93710342c741e8c0427bdbf8273d31a0aa627 100644 (file)
@@ -40,7 +40,7 @@
 /* Some kernels have this typedef backported so we cannot reliably
  * detect based on version number, hence we forcibly #define it.
  */
-#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H)
+#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) || defined(_LINUX_KERNEL_H)
 #define gfp_t unsigned
 #endif
 
 #define atomic_notifier_call_chain(chain,val,v) notifier_call_chain(chain,val,v)
 #endif
 
+#if defined(_LINUX_MM_H) && defined set_page_count
+#define init_page_count(page) set_page_count(page, 1)
+#endif
+
+#if defined(__LINUX_GFP_H) && !defined __GFP_NOMEMALLOC
+#define __GFP_NOMEMALLOC 0
+#endif
+
 #if defined(_LINUX_FS_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
 #define nonseekable_open(inode, filp) /* Nothing to do */
 #endif
@@ -75,6 +83,10 @@ void *kzalloc(size_t size, int flags);
 #define end_that_request_last(req, uptodate) end_that_request_last(req)
 #endif
 
+#if defined(_LINUX_CAPABILITY_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
+#define capable(cap) (1)
+#endif
+
 #if defined(_LINUX_KERNEL_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
 extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
        __attribute__ ((format (printf, 2, 3)));